import 'package:flutter/material.dart';
import '../main.dart';

class ScreenUtils{
    /// screen width
  /// 当前屏幕 宽
  static double getScreenW() {
    MediaQueryData mediaQuery = MediaQuery.of(AppInfo.materialContext);
    return mediaQuery.size.width;
  }

  /// screen height
  /// 当前屏幕 高
  static double getScreenH() {
    MediaQueryData mediaQuery = MediaQuery.of(AppInfo.materialContext);
    return mediaQuery.size.width;
  }

  /// screen density
  /// 当前屏幕 像素密度
  static double getScreenDensity() {
    MediaQueryData mediaQuery = MediaQuery.of(AppInfo.materialContext);
    return mediaQuery.devicePixelRatio;
  }

  /// status bar Height
  /// 当前状态栏高度
  static double getStatusBarH() {
    MediaQueryData mediaQuery = MediaQuery.of(AppInfo.materialContext);
    return mediaQuery.padding.top;
  }

  /// status bar Height
  /// 当前BottomBar高度
  static double getBottomBarH() {
    MediaQueryData mediaQuery = MediaQuery.of(AppInfo.materialContext);
    return mediaQuery.padding.bottom;
  }


  static double fixW(num w){
    return w;//ScreenUtil().setWidth(w);
  }
  static double fixH(num h){
    return h;//ScreenUtil().setWidth(h);
  }
  static double fixF(num fontSize,{bool scale = true}){
    return fontSize;//ScreenUtil().setSp(fontSize,allowFontScalingSelf: scale);
  }

}



